/**
 * file
 */
package com.tdkj.model.user;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.tdkj.model.base.BaseEntity;

/**
 * 
 * FileName: BeanPublishWebsite.java
 * 
 * @Description: TODO发布站内信
 * 
 *               All rights Reserved, Designed By ZTE-ITS
 * 
 *               Copyright: Copyright(C) 2010-2011
 * 
 *               Company 天成科技有限公司
 * 
 * @author: 李兴建
 * 
 * @version V1.0
 * 
 *          Createdate: 2012-7-26 下午07:45:54
 * 
 * 
 * 
 *          Modification History:
 * 
 *          Date Author Version Discription
 * 
 * 
 * 
 *          
 *          ----------------------------------------------------------------------
 *          -------------
 * 
 *          2012-7-26 李兴建 1.0 1.0
 * 
 *          Why & What is modified: <修改原因描述>
 */
@Entity
@Table(name = "common_message")
public class BeanMessage extends BaseEntity {
	private static final long serialVersionUID = 2854470893549711942L;
	// 站内信标题
	private Timestamp createtime;
	// 发布对象
	private String title;
	// 内容
	private String content;
	// 是否是全部用户
	private boolean allUser;
	// 接收的用户等级
	private BeanUserLevel beanUserLevel;
	// 发布信息的管理员
	private BeanAdmin beanAdmin;
	// 0:管理发布的站内消息     1：用户之间发送的消息
	private int msgtype;
	//发送消息者
	private BeanUser sender;
	//接收消息者
	private BeanUser reciver;

	public int getMsgtype() {
		return msgtype;
	}

	public void setMsgtype(int msgtype) {
		this.msgtype = msgtype;
	}

	@OneToOne(cascade = CascadeType.REFRESH,fetch = FetchType.LAZY)
	public BeanUser getSender() {
		return sender;
	}

	public void setSender(BeanUser sender) {
		this.sender = sender;
	}

	@OneToOne(cascade = CascadeType.REFRESH,fetch = FetchType.LAZY)
	public BeanUser getReciver() {
		return reciver;
	}

	public void setReciver(BeanUser reciver) {
		this.reciver = reciver;
	}

	public Timestamp getCreatetime() {
		return createtime;
	}

	public void setCreatetime(Timestamp createtime) {
		this.createtime = createtime;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public boolean isAllUser() {
		return allUser;
	}

	public void setAllUser(boolean allUser) {
		this.allUser = allUser;
	}
	
	@OneToOne(cascade = CascadeType.REFRESH,fetch = FetchType.LAZY)
	public BeanUserLevel getBeanUserLevel() {
		return beanUserLevel;
	}

	public void setBeanUserLevel(BeanUserLevel beanUserLevel) {
		this.beanUserLevel = beanUserLevel;
	}
	@OneToOne(cascade = CascadeType.REFRESH,fetch = FetchType.LAZY)
	public BeanAdmin getBeanAdmin() {
		return beanAdmin;
	}

	public void setBeanAdmin(BeanAdmin beanAdmin) {
		this.beanAdmin = beanAdmin;
	}

}
